/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package quanlynhatre.Model;

import java.awt.List;
import java.util.Date;

/**
 *
 * @author VOTHUY
 */
public class Nguoi {
    
    protected String ID;
    protected String HoTen;
    protected Date NgaySinh;
    protected DiaChi dc;
    protected String DanToc;
    protected String TonGiao;
    protected String GioiTinh;
    
    public Nguoi()
    {}
   
    public Nguoi(String id, String hoten,Date ngaysinh, String gioitinh, String dantoc, String tongiao){
		this.ID = id;
		this.HoTen = hoten;
		this.NgaySinh  =ngaysinh;
		this.GioiTinh = gioitinh;
		this.TonGiao = tongiao;
                this.DanToc = dantoc;
                this.dc = new DiaChi();
	}
    
    public String getID()
    {
        return ID;
    }
    
    public boolean setID(String value)
    {
        if ( value.length() == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "ID khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else if ( value.length() > 50 )
            javax.swing.JOptionPane.showMessageDialog(null, "ID khong duoc phep lon hon 50 ky tu","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else
        {
            this.ID = value;
            return true;
        }
        return false;
    }
    
    public String getHoTen()
    {
        return HoTen;
    }
    
    public boolean setHoTen(String value)
    {
        if ( value.length() == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "Ho ten khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else if ( value.length() > 50 )
            javax.swing.JOptionPane.showMessageDialog(null, "Ho ten khong duoc phep lon hon 50 ky tu","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else
        {
            this.ID = value;
            return true;
        }
        return false;
    }
    
    public Date getNgaySinh()
    {
        return NgaySinh;
    }
    
    public boolean setNgaySinh(Date value)
    {
        if ( value.toString().length() == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "ID khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        
        else
        {
            this.NgaySinh = value;
            return true;
        }
        return false;
    }
    
    public DiaChi getDC()
    {
        return dc;
    }
    
    public void setID(DiaChi dc)
    {
        this.dc = dc;
    }
    
    public String getDanToc()
    {
        return DanToc;
    }
    
    public boolean setDanToc(String value)
    {
        if ( value.length() == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "Dan toc khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else if ( value.length() > 50 )
            javax.swing.JOptionPane.showMessageDialog(null, "Dan toc khong duoc phep lon hon 50 ky tu","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else
        {
            this.DanToc = value;
            return true;
        }
        return false;
    }
    
    public String getTonGiao()
    {
        return DanToc;
    }
    
    public void setTonGiao(String tg)
    {
        this.TonGiao = tg;
    }
    
}
